/*
 * spi_master_hal.c
 *
 *  Created on: 8 janv. 2014
 *      Author: crma
 */

#include "hal/spi_master_hal.h"
#include "bsp/spi_regs.h"
#include "hal/register.h"


void spi_master_host_busy_set(bool b);



bool spi_master_hal_init ( void )
{
  spi_master_host_busy_set(false);
  return true;
}


bool spi_master_hal_host_busy_get ( void )
{
  uint32_t spi_master_status=mock_registers[SPI_STATUS_REG];

  return (spi_master_status & 0x01);
}


void spi_master_host_busy_set(bool b)
{
  if(b==true){
    mock_registers[SPI_STATUS_REG] |= 0x01;
  }
  else{
    mock_registers[SPI_STATUS_REG] &= ~0x01;
  }
}
